﻿package com.shane.xmlstuff {	import flash.display.Sprite;	import flash.events.*;	import flash.net.URLLoader;    import flash.net.URLRequest;	import flash.errors.IOError;		public class XMLTextLoader extends Sprite {		private var numOfItems:int = 0;		private var xmlLoader:URLLoader = new URLLoader();		private var xmlData:XML = new XML();		public var titleContent:String;		public var bodyCopy:String;				public function XMLTextLoader(path) :void {			xmlLoader.addEventListener(Event.COMPLETE, completed);			try {			xmlLoader.load(new URLRequest(path));			} catch (error:IOError) {				trace("xml not loaded");			}					}				function completed(e:Event):void {			xmlData = new XML(e.target.data);			parse(xmlData);		}				function parse(boomXML:XML):void {			titleContent = boomXML.title;			bodyCopy = boomXML.bodyCopy;						this.dispatchEvent(new Event("eventXMLoaded"));		}	}}